#include<iostream>
#include<queue>

using namespace std;

class Solution {
public:
	uint32_t reverseBits(uint32_t n) {
		queue<int> t;
		uint32_t m=1;
		for(int i=0;i<32;i++)
		{
			t.push(n % 2);
			n = n / 2;
		}
		while (t.size())
		{
			m = m * 2 + t.front();
			t.pop();
		}
		return m;
	}
};

//int main()
//{
//	Solution *s = new Solution;
//	cout << s->reverseBits(43261596);
//	return 0;
//}